//
//  UIView+ExtraAnimation.h
//
//  Created by Water Lou on 15/09/2010.
//  Copyright 2010 First Water Tech Ltd. All rights reserved.
// 
//  many visual effects and animation effects create using CoreAnimation and CALayer
//

#import <Foundation/Foundation.h>


typedef enum : NSUInteger {
    BorderTypeTop,
    BorderTypeLeft,
    BorderTypeRight,
    BorderTypeBottom
} BorderType; //边框位置


@interface UIView(HG)


// set round corner
- (void) setCornerRadius : (CGFloat) radius;
// 设置View的边框  上下左右都设置
- (void) setBorder : (UIColor *) color width : (CGFloat) width;
//设置View的边框  types代表边框位置数组
- (void)addBorderWithColor:(UIColor *)color size:(CGFloat)size borderTypes:(NSArray *)types;
//设置View的边框  types代表边框位置
- (void)addBorderLayerWithColor:(UIColor *)color size:(CGFloat)size borderType:(BorderType)boderType;

// set the shadow
// Example: [view setShadow:[UIColor blackColor] opacity:0.5 offset:CGSizeMake(1.0, 1.0) blueRadius:3.0];
- (void) setShadow : (UIColor *)color opacity:(CGFloat)opacity offset:(CGSize) offset blurRadius:(CGFloat)blurRadius;


+ (id)inflate:(NSString *)xib owner:(id)owner;

- (id)findFirstResponderView;

//判断self是否包含view
- (BOOL)containsView:(UIView *)view;

//获取所在的cell
- (id)superViewOf:(Class)viewClass;

//将itemviews垂直添加到self中,如果sepColor==nil则不要sep
- (void)addVerticalItemViews:(NSArray<UIView*>*)itemViews
                withSepColor:(UIColor*)sepColor
                      topSep:(BOOL)top//是否在最上方添加sep
                   bottomSep:(BOOL)bottom //是否在最下方添加sep
                    hPadding:(CGFloat)hPadding;//水平方向的间隔
//将itemviews垂直添加到self中,如果sepColor==nil则不要sep
- (void)addVerticalItemViews:(NSArray<UIView*>*)itemViews
                withSepColor:(UIColor*)sepColor
                      topSep:(BOOL)top//是否在最上方添加sep
                   bottomSep:(BOOL)bottom //是否在最下方添加sep
                    hPadding:(CGFloat)hPadding//水平方向的间隔
               minItemHeight:(CGFloat)minItemHeight;//item的最小高度

//点击事件
- (void)setTapBlock:(dispatch_block_t)block;


@property (nonatomic) CGFloat left;

/**
 * Shortcut for frame.origin.y
 *
 * Sets frame.origin.y = top
 */
@property (nonatomic) CGFloat top;

/**
 * Shortcut for frame.origin.x + frame.size.width
 *
 * Sets frame.origin.x = right - frame.size.width
 */
@property (nonatomic) CGFloat right;

/**
 * Shortcut for frame.origin.y + frame.size.height
 *
 * Sets frame.origin.y = bottom - frame.size.height
 */
@property (nonatomic) CGFloat bottom;

/**
 * Shortcut for frame.size.width
 *
 * Sets frame.size.width = width
 */
@property (nonatomic) CGFloat width;

/**
 * Shortcut for frame.size.height
 *
 * Sets frame.size.height = height
 */
@property (nonatomic) CGFloat height;

/**
 * Shortcut for center.x
 *
 * Sets center.x = centerX
 */
@property (nonatomic) CGFloat centerX;

/**
 * Shortcut for center.y
 *
 * Sets center.y = centerY
 */
@property (nonatomic) CGFloat centerY;

@end
